import request from '@/utils/request'

// 新增题库
export function addBank(data) {
	return request({
		url: '/admin/resource/question/bank',
		method: 'post',
		data,
		showLoading: true
	})
}

// 批量增加题库
export function addMoreBank(data) {
	return request({
		url: '/admin/resource/question/bank/batch/save',
		method: 'post',
		data,
		showLoading: true
	})
}

// 题库分页
export function pagingBank(data) {
	return request({
		url: '/admin/resource/question/bank/paging',
		method: 'post',
		data,
		showLoading: true
	})
}
// 题库列表
export function listBank(data) {
	return request({
		url: '/admin/resource/question/bank/list',
		method: 'post',
		data,
		showLoading: true
	})
}

// 题库详情
export function getBankDetail(id) {
	return request({
		url: '/admin/resource/question/bank/' + id,
		method: 'get',
		showLoading: true
	})
}
// 修改题库
export function editBank(data) {
	return request({
		url: '/admin/resource/question/bank',
		method: 'put',
		data,
		showLoading: true
	})
}
// 批量删除题库
export function delBank(idList) {
	return request({
		url: '/admin/resource/question/bank/' + idList,
		method: 'delete',
		showLoading: true
	})
}
// 题库上下架
export function publishBank(data) {
	return request({
		url: '/admin/resource/question/bank/publish',
		method: 'put',
		data,
		showLoading: true
	})
}
// 题库导入
export function importBank(data) {
	return request({
		url: '/admin/resource/question/bank/import',
		method: 'post',
		data,
		showLoading: true
	})
}
// 题库导出
export function exportBank(data) {
	return request({
		url: '/admin/resource/question/bank/export',
		method: 'post',
		data,
		showLoading: true
	})
}

// 关联建培圈题库列表
export function listAssoBank(data) {
	return request({
		url: '/api/bank/list',
		method: 'post',
		data,
		showLoading: true,
		isJPQServer: true
	})
}
